using System; using System.Data; using System.Windows.Forms; using System.Xml;
namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { XmlReader xmlFile; xmlFile = XmlReader.Create("Product.xml", new XmlReaderSettings()); DataSet ds = new DataSet(); DataView dv; ds.ReadXml(xmlFile); dv = new DataView(ds.Tables[0], "Product_price > = 3000", "Product_Name", DataViewRowState.CurrentRows); dv.ToTable().WriteXml("Result.xml"); MessageBox.Show("Done"); } } }
Liked By
Write Answer
Filter in a XML file in C#
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Sumit Kesarwani
15-Jun-2013